#import "TSFinishDetailController.h"
#import "TSSuggestController.h"
#import "TSFinishTableView.h"
#import "TSAuditEditController.h"
@implementation TSFinishDetailController


-(UIActionSheet *)createActionSheet
{
    WS(weakSelf);
    UIActionSheet * actionSheet;
    switch (self.detailType) {
        case FinishDetail_Type_wait:
            actionSheet=[[UIActionSheet alloc] initWithTitle:nil delegate:weakSelf cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"查看进度",@"查看监督人",@"查看审核人",
             @"查看建议列表",@"任务评审",nil];
            break;
        case FinishDetail_Type_already:
            actionSheet=[[UIActionSheet alloc] initWithTitle:nil delegate:weakSelf cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"查看进度",@"查看监督人",@"查看审核人",
                         @"查看建议列表",nil];
            break;
        case FinishDetail_Type_no:
            actionSheet=[[UIActionSheet alloc] initWithTitle:nil delegate:weakSelf cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"查看进度",@"查看监督人",@"查看审核人",
                         @"查看建议列表",nil];
            break;
        default:
            break;
    }
    
    return actionSheet;
}
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
     if(buttonIndex == 0){
        [super getProgress];
    }
    else if(buttonIndex == 1){
        [super showSupervisers];
    }
    else if(buttonIndex== 2){
        [super showAuditors];
    }
    else if(buttonIndex== 3){
        [self showSuggest];
    }else if (buttonIndex== 4){
        [self taskAudit];
    }
}

-(void)taskAudit{
    TSAuditEditController * audit_col = [[TSAuditEditController alloc] init];
    audit_col.taskId = self.taskModel.tId;
    [self.navigationController pushViewController:audit_col animated:YES];
}

@end
